/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.account.core.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import com.gitee.peigenlpy.sansheng.core.annotation.ColumnField;
import info.peigen.hotpot.common.core.enums.BankCode;
import info.peigen.hotpot.common.core.enums.CardAccountType;
import info.peigen.hotpot.component.data.repository.beetlsql.entity.AbstractCreateTimeEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

/**
 * <b>(BankEntity)</b>
 * 银行表
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/1
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "bank", comment = "银行表", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "bank")
public class BankEntity extends AbstractCreateTimeEntity {
    @ColumnField(change = false)
    @Column(name = "bank_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "银行Id")
    @Unique(value = "bankId", columns = "bank_id")
    @org.beetl.sql.annotation.entity.Column("bank_id")
    String          bankId;
    @Column(name = "name", type = MySqlTypeConstant.VARCHAR, length = 100, isNull = false, comment = "银行名")
    @org.beetl.sql.annotation.entity.Column("name")
    String          name;
    @Column(name = "bank_code", type = MySqlTypeConstant.VARCHAR, length = 30, comment = "英文缩写")
    @Unique(value = "bankCode", columns = "bank_code,name,account_type")
    @org.beetl.sql.annotation.entity.Column("bank_code")
    BankCode        bankCode;
    @Column(name = "swift_code", type = MySqlTypeConstant.VARCHAR, length = 30, comment = "银行国际识别码")
    @org.beetl.sql.annotation.entity.Column("swift_code")
    String          swiftCode;
    @Column(name = "account_type", type = MySqlTypeConstant.VARCHAR, length = 50, comment = "银行卡账户类型")
    @Index(value = "accountType", columns = "account_type")
    @org.beetl.sql.annotation.entity.Column("account_type")
    CardAccountType accountType;
    @Column(name = "address", type = MySqlTypeConstant.JSON, length = 500, comment = "地址")
    @org.beetl.sql.annotation.entity.Column("address")
    String          address;
    @Column(name = "bank", type = MySqlTypeConstant.JSON, length = 500, comment = "全集")
    @org.beetl.sql.annotation.entity.Column("bank")
    String          bank;
}